package cn.com.ccxe.core.index;

import java.io.File;
import java.io.IOException;
import java.util.concurrent.locks.Lock;
import java.util.concurrent.locks.ReentrantLock;

import org.apache.lucene.store.Directory;
import org.apache.lucene.store.SimpleFSDirectory;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import cn.com.ccxe.core.util.Configurations;

public class IndexReader {
	
	private static Directory directory = null;
	private static File directoryHome;
	private Lock lock = new ReentrantLock();
	private static int DRAIN_MAX_ELEMENT = 50;
	private static Logger logger = LoggerFactory.getLogger(Indexer.class);
	private static String DIRECTORY_PATH = Configurations.getString("index.path", "/directory");
	
	static {
		try {
			directoryHome = new File(DIRECTORY_PATH);
			directory = new SimpleFSDirectory(directoryHome);
			logger.info("---------------------directory:" + directory);
			if (directory == null) {
				throw new NullPointerException();
			}
		} catch (IOException e) {
			e.printStackTrace();
		}
	}
	
	public static void main(String[] args) {
		
	}
	
}
